﻿///***************************************************************
/// 시  스  템 : Updms.Crd.Dac
/// 단위시스템 : CRD
/// 계      층 : Data Access Layer
/// 프로그램명 : Crd_Dac_UPDMS_CRD_PAYMNT_DT
/// 파  일  명 : Crd_Dac_UPDMS_CRD_PAYMNT_DT.cs
/// 설      명 : 카드결제일
///***************************************************************
/// 수정ID 일자       이름     내용
///---------------------------------------------------------------
/// CH001  2008-07-18 송시명   최초 작성
///***************************************************************
using System.Data;
using System.Data.SqlClient;
using System.EnterpriseServices;
using System.Runtime.InteropServices;

using SMFramework.Data;


namespace Updms.Crd.Dac
{
	[ComVisible(true)]
	[Transaction(TransactionOption.Supported)]
	[JustInTimeActivation(true)]
	public class Crd_Dac_UPDMS_CRD_PAYMNT_DT : Base.AppFramework.DacBase
	{
		public Crd_Dac_UPDMS_CRD_PAYMNT_DT()
		{
		}

		#region NT [GetSearchCount]
		
		[AutoComplete]
		public int GetSearchCount(DataPack lo_dp)
		{
			string ls_sql = "usp_UPDMS_CRD_PAYMNT_DT_Get_Search_Count";
			
			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			
			return (int)_agent.ExecuteScalar(ls_sql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region NT [SelectProcess]
		
		[AutoComplete]
		public DataSet SelectProcess(DataPack lo_dp)
		{
			string ls_sql = "usp_UPDMS_CRD_PAYMNT_DT_Select_Paging";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			DataSet ds = new DataSet();
			return _agent.Fill(ls_sql, "UPDMS_CRD_PAYMNT_DT", ds, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region NT [GetPaymntDtList]

		[AutoComplete]
		public DataSet GetPaymntDtList(string ls_card_cd)
		{
			string ls_sql = "usp_UPDMS_CRD_PAYMNT_DT_Get_Paymnt_Dt_List";

			SqlParameter[] paramArray =
			{
				new SqlParameter("ls_card_cd", ls_card_cd)
			};

			DataSet ds = new DataSet();
			return _agent.Fill(ls_sql, "UPDMS_CRD_PAYMNT_DT", ds, paramArray, CommandType.StoredProcedure);
		}

		#endregion

		#region NT [GetPaymntDtByBizDt]

		[AutoComplete]
		public string GetPaymntDtByBizDt(DataPack lo_dp)
		{
			string ls_sql = "usp_UPDMS_CRD_PAYMNT_DT_Get_Paymnt_Dt_By_Biz_Dt";
			
			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			return (string)_agent.ExecuteScalar(ls_sql, paramArray, CommandType.StoredProcedure);
		}

		#endregion

		#region NT [GetMinNMaxPaymntDt]
		/// <summary>
		/// 카드별로 등록된 처음 결제일과 마지막 결제일을 조회 - 조회날짜 설정시 사용
		/// </summary>
		/// <param name="lo_dp"></param>
		/// <returns></returns>
		[AutoComplete]
		public DataSet GetMinNMaxPaymntDt(DataPack lo_dp)
		{
			string ls_sql = "usp_UPDMS_CRD_PAYMNT_DT_Get_Min_N_Max_Paymnt_Dt";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			DataSet ds = new DataSet();
			return _agent.Fill(ls_sql, "UPDMS_CRD_PAYMNT_DT", ds, paramArray, CommandType.StoredProcedure);		
		}

		#endregion

		#region NT [GetMinNMaxBizDt]
		/// <summary>
		/// 카드별로 등록된 처음 사용일과 마지막 사용일을 조회
		/// </summary>
		/// <param name="lo_dp"></param>
		/// <returns></returns>
		[AutoComplete]
		public DataSet GetMinNMaxBizDt(DataPack lo_dp)
		{
			string ls_sql = "usp_UPDMS_CRD_PAYMNT_DT_Get_Min_N_Max_Biz_Dt";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			DataSet ds = new DataSet();
			return _agent.Fill(ls_sql, "UPDMS_CRD_PAYMNT_DT", ds, paramArray, CommandType.StoredProcedure);
		}

		#endregion		
		

		#region RT [Insert]
		
		[AutoComplete]
		public int Insert(DataPack lo_dp)
		{
			string ls_sql = "usp_UPDMS_CRD_PAYMNT_DT_Insert";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			return _agent.ExecuteNonQuery(ls_sql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region RT [Update]
		
		[AutoComplete]
		public int Update(DataPack lo_dp)
		{
			string ls_sql = "usp_UPDMS_CRD_PAYMNT_DT_Update";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			return _agent.ExecuteNonQuery(ls_sql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region RT [Delete]
		
		[AutoComplete]
		public int Delete(string ls_xml)
		{
			string ls_sql = "usp_UPDMS_CRD_PAYMNT_DT_Delete";

			SqlParameter[] paramArray =
			{
				new SqlParameter("ls_xml", ls_xml)
			};
			
			return _agent.ExecuteNonQuery(ls_sql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion
	}
}
